﻿using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace Nextensions.Net.Protocols.Http
{
    public class HttpRequest
    {
        public HttpRequest(string url)
        {
            Url = url;
        }

        public HttpRequest(string url, List<string> cookies, Encoding encoding)
        {
            Url = url;
            Cookies = cookies;
            Encoding = encoding;
        }

        public HttpRequest(string url, List<string> cookies, List<KeyValuePair<string, string>> headers, Encoding encoding)
        {
            Url = url;
            Cookies = cookies;
            Headers = headers;
            Encoding = encoding;
        }

        public HttpRequest(
            string url,
            string postData,
            string contentType,
            RequestMethods method,
            List<string> cookies,
            List<KeyValuePair<string, string>> headers,
            Encoding encoding,
            string userName,
            string password,
            string domain)
        {
            Url = url;
            Post = postData;
            ContentType = contentType;
            Method = method;
            Cookies = cookies;
            Headers = headers;
            Encoding = encoding;
            UserName = userName;
            Password = password;
            Domain = domain;
        }

        /*public static HttpRequest Create(
            string url, 
            string postData, 
            string contentType,
            RequestMethods method,
            List<string> cookies,
            List<KeyValuePair<string, string>> headers, 
            Encoding encoding, 
            string userName,
            string password, 
            string domain)
        {
            var request = new HttpRequest(url, postData, contentType, method, cookies, headers, encoding, userName, password, domain);

            

            return request;
        }*/

        public string Url { get; set; }

        public string Post { get; set; }

        public string ContentType { get; set; }

        [DefaultValue(RequestMethods.GET)]
        public RequestMethods Method { get; set; }

        public List<string> Cookies { get; set; }

        public List<KeyValuePair<string, string>> Headers { get; set; }

        public Encoding Encoding { get; set; }

        public string UserName { get; set; }

        public string Password { get; set; }

        public string Domain { get; set; }
    }
}